package com.shine.app.network;

import org.springframework.http.HttpMethod;

import com.shine.app.bean.SearchBean;
import com.shine.app.bean.request.ConfirmRegisterUserBean;
import com.shine.app.bean.request.ConfirmUnregisterUserBean;
import com.shine.app.bean.request.CredentialBean;
import com.shine.app.bean.request.ExternalAccount;
import com.shine.app.bean.request.FindBookingBean;
import com.shine.app.bean.request.FindTeeTimesBean;
import com.shine.app.bean.request.LocationNearBean;
import com.shine.app.bean.request.PaymentRegisterUserBean;
import com.shine.app.bean.request.PaymentUnregisterUserBean;
import com.shine.app.bean.request.ReviewsUpdateBean;
import com.shine.app.bean.request.ReviewsWriteBean;
import com.shine.app.bean.request.SignUpBean;
import com.shine.app.bean.request.UpdatePasswordBean;
import com.shine.app.bean.request.UpdateProfileBean;
import com.shine.app.bean.request.ValidateBean;
import com.shine.app.bean.responses.AuthenticateUserResponse;
import com.shine.app.bean.responses.BookingConfirmResponse;
import com.shine.app.bean.responses.BookingConfirmationResponse;
import com.shine.app.bean.responses.FindTeeTimeListViewResponse;
import com.shine.app.bean.responses.FindTeeTimePriceResponse;
import com.shine.app.bean.responses.GetMyFavoriteResponse;
import com.shine.app.bean.responses.GetMyReviewsResponse;
import com.shine.app.bean.responses.GetMyTeeTimesResponse;
import com.shine.app.bean.responses.GolfCourseDetailResponse;
import com.shine.app.bean.responses.GolferReviewResponse;
import com.shine.app.bean.responses.PlaceNearResponse;
import com.shine.app.bean.responses.ReviewsWriteResponse;
import com.shine.app.bean.responses.TeeTimesResponse;
import com.shine.app.bean.responses.UpdateUserProfileResponse;
import com.shine.app.bean.responses.ValidateResponse;
import com.shine.app.bean.responses.ViewMyGolfResponse;
import com.shine.app.commons.OpenTeeServiceClientImpl;
import com.shine.app.commons.Urls;

public class OpenTeeClientProxy {

	private static OpenTeeClientProxy openTeeClientProxy;

	public static OpenTeeClientProxy getInstance() {
		if (openTeeClientProxy == null) {
			synchronized (OpenTeeClientProxy.class) {
				if (openTeeClientProxy == null) {
					openTeeClientProxy = new OpenTeeClientProxy();
				}
			}
		}
		return openTeeClientProxy;
	}

	public AuthenticateUserResponse authenticateUser(
			CredentialBean credentialBean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AuthenticateUser");
		AuthenticateUserResponse response = OpenTeeServiceClientImpl
				.getInstance().execute(credentialBean,
						AuthenticateUserResponse.class,
						builder.toString().trim(), HttpMethod.POST);
		return response;
	}

	public AuthenticateUserResponse createUserWithExternalAccount(
			ExternalAccount account) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CreateUserWithExternalAccount");
		builder.append("?email=" + account.getEmail());
		builder.append("&firstName=" + account.getFirstName());
		builder.append("&lastName=" + account.getLastName());
		builder.append("&phoneNumber=" + account.getPhoneNumber());
		builder.append("&externalAccountType="
				+ account.getExternalAccountType());
		builder.append("&externalUserId=" + account.getExternalUserId());
		builder.append("&externalData=" + account.getExternalData());
		AuthenticateUserResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null, AuthenticateUserResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public AuthenticateUserResponse createUser(SignUpBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CreateUser");
		AuthenticateUserResponse response = OpenTeeServiceClientImpl
				.getInstance().execute(bean, AuthenticateUserResponse.class,
						builder.toString().trim(), HttpMethod.POST);
		return response;
	}

	public UpdateUserProfileResponse updateUserProfile(UpdateProfileBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("UpdateUserProfile");
		UpdateUserProfileResponse response = OpenTeeServiceClientImpl
				.getInstance().execute(bean, UpdateUserProfileResponse.class,
						builder.toString().trim(), HttpMethod.POST);
		return response;
	}

	public ValidateResponse changePassword(UpdatePasswordBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("ChangePassword");
		String userId = Urls.urlEncode(bean.getUserId());
		builder.append("?userId=" + userId);
		builder.append("&currentPassword=" + bean.getCurrentPassword());
		builder.append("&newPassword=" + bean.getNewPassword());
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public ValidateResponse forgotPassword(String email) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("ForgotPassword");
		builder.append("?email=" + email);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public PlaceNearResponse placesByCountryAndNameNearest(LocationNearBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("PlacesByCountryAndNameNearest");
		builder.append("?count=" + bean.getCount());
		builder.append("&latitude=" + bean.getLatitude());
		builder.append("&longitude=" + bean.getLongitude());
		builder.append("&name=" + bean.getName());
		builder.append("&type=" + bean.getType());
		PlaceNearResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(null, PlaceNearResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;
	}

	public PlaceNearResponse placesByCountryAndName(LocationNearBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("PlacesByCountryAndName");
		builder.append("?count=" + bean.getCount());
		builder.append("&name=" + bean.getName());
		builder.append("&type=" + bean.getType());
		PlaceNearResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(null, PlaceNearResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;
	}

	public FindTeeTimePriceResponse availableTeeTimesByCountryRateGroup(
			FindTeeTimesBean bean, boolean isLogin, int startIndex) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AvailableTeeTimesByCountryRateGroup");
		String parameter = getUrl(bean, startIndex, isLogin);
		builder.append(parameter);
		builder.append("&count=5");
		FindTeeTimePriceResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null, FindTeeTimePriceResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public FindTeeTimeListViewResponse availableTeeTimesByCountryAndNearest(
			FindTeeTimesBean bean, int startIndex, boolean isLogin) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AvailableTeeTimesByCountryAndNearest");
		String parameter = getUrl(bean, startIndex, isLogin);
		builder.append(parameter);
		builder.append("&count=10");
		FindTeeTimeListViewResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null,
						FindTeeTimeListViewResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public FindTeeTimeListViewResponse availableTeeTimesByCountry(
			FindTeeTimesBean bean, int startIndex, boolean isLogin, int orderBy) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AvailableTeeTimesByCountry");
		String parameter = getUrl(bean, startIndex, isLogin);
		builder.append(parameter);
		builder.append("&count=10");
		builder.append("&orderBy=" + orderBy);
		FindTeeTimeListViewResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null,
						FindTeeTimeListViewResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	private String getUrl(FindTeeTimesBean bean, int startIndex, boolean isLogin) {
		StringBuilder builder = new StringBuilder();
		builder.append("?country=" + bean.getCountry());
		builder.append("&date=" + bean.getDate());
		builder.append("&distanceMax=" + bean.getDistanceMax());
		builder.append("&distanceMin=" + bean.getDistanceMin());
		builder.append("&latitude=" + bean.getLatitude());
		builder.append("&longitude=" + bean.getLongitude());
		builder.append("&name=");
		builder.append("&numberOfPlayers=" + bean.getNumberOfPlayers());
		builder.append("&rateMax=" + bean.getRateMax());
		builder.append("&rateMin=" + bean.getRateMin());
		builder.append("&ratingMax=" + bean.getRatingMax());
		builder.append("&ratingMin=" + bean.getRatingMin());
		builder.append("&reviewAverageMax=" + bean.getReviewAverageMax());
		builder.append("&reviewAverageMin=" + bean.getReviewAverageMin());
		builder.append("&roundTimeMax=" + bean.getRoundTimeMax());
		builder.append("&roundTimeMin=" + bean.getRoundTimeMin());
		builder.append("&slopeMax=" + bean.getSlopeMax());
		builder.append("&slopeMin=" + bean.getSlopeMin());
		builder.append("&startIndex=" + startIndex);
		builder.append("&timeMax=" + bean.getTimeMax());
		builder.append("&timeMin=" + bean.getTimeMin());
		builder.append("&specialsFilter=" + bean.getSpecialsFilter());
		if (isLogin) {
			String golferId = bean.getGolferId();
			golferId = Urls.urlEncode(golferId);
			builder.append("&golferId=" + bean.getGolferId());
		}
		return builder.toString().trim();
	}

	public GolfCourseDetailResponse courseDetail(int courseId) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CourseDetail");
		builder.append("?courseId=" + courseId);
		GolfCourseDetailResponse response = OpenTeeServiceClientImpl
				.getInstance().execute(null, GolfCourseDetailResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;

	}

	public GolfCourseDetailResponse coursesByIds(int courseId) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CoursesByIds");
		builder.append("?courseId=" + courseId);
		GolfCourseDetailResponse response = OpenTeeServiceClientImpl
				.getInstance().execute(null, GolfCourseDetailResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;

	}

	public TeeTimesResponse availableTeeTimesByCourseId(int courseId,
			SearchBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AvailableTeeTimesByCourseId");
		builder.append("?courseId=" + courseId);
		builder.append("&date=" + bean.getDate());
		builder.append("&numberOfPlayers=" + bean.getPlayer());
		TeeTimesResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(null, TeeTimesResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;
	}

	public ReviewsWriteResponse addCourseReview(ReviewsWriteBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.REVIEW_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AddCourseReview");
		ReviewsWriteResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(bean, ReviewsWriteResponse.class,
						builder.toString().trim(), HttpMethod.POST);
		return response;
	}

	public GolferReviewResponse getCourseReviews(int courseId) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.REVIEW_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("GetCourseReviews");
		builder.append("?courseId=" + courseId);
		GolferReviewResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(null, GolferReviewResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;
	}

	public ValidateResponse validateTeetime(ValidateBean bean) {
		String time = bean.getTeeTime();
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("ValidateTeetime");
		builder.append("?courseId=" + bean.getCourseId());
		builder.append("&teeTime=" + time);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.execute(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.GET);
		return response;
	}

	public BookingConfirmResponse bookTeeTimeForUser(Boolean flag,
			ConfirmRegisterUserBean confirmRegisterUserBean,
			ConfirmUnregisterUserBean confirmUnregisterUserBean) {
		BookingConfirmResponse response = null;
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		if (flag) {
			builder.append("BookTeeTimeForRegisteredUserRequest");
			response = OpenTeeServiceClientImpl.getInstance().execute(
					confirmRegisterUserBean, BookingConfirmResponse.class,
					builder.toString().trim(), HttpMethod.POST);
		} else {
			builder.append("BookTeeTimeForUnregisteredUser");
			response = OpenTeeServiceClientImpl.getInstance().execute(
					confirmUnregisterUserBean, BookingConfirmResponse.class,
					builder.toString().trim(), HttpMethod.POST);
		}
		return response;
	}

	public BookingConfirmResponse bookAndPayForUser(Boolean flag,
			PaymentRegisterUserBean paymentRegisterUserBean,
			PaymentUnregisterUserBean paymentUnregisterUserBean) {
		BookingConfirmResponse response = null;
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		if (flag) {
			builder.append("BookTeeTimeForRegisteredUserRequest");
			response = OpenTeeServiceClientImpl.getInstance().execute(
					paymentRegisterUserBean, BookingConfirmResponse.class,
					builder.toString().trim(), HttpMethod.POST);
		} else {
			builder.append("BookTeeTimeForUnregisteredUser");
			response = OpenTeeServiceClientImpl.getInstance().execute(
					paymentUnregisterUserBean, BookingConfirmResponse.class,
					builder.toString().trim(), HttpMethod.POST);
		}
		return response;
	}

	public BookingConfirmationResponse getReservationByReservationId(
			String reservationId) {
		reservationId = Urls.urlEncode(reservationId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("GetReservationByReservationId");
		builder.append("?reservationId=" + reservationId);
		BookingConfirmationResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null,
						BookingConfirmationResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public ViewMyGolfResponse golfer(String golferId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("Golfer");
		builder.append("?golferId=" + golferId);
		ViewMyGolfResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ViewMyGolfResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public GetMyTeeTimesResponse getFutureReservationsByGolfer(String golferId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("GetFutureReservationsByGolfer");
		builder.append("?golferId=" + golferId);
		GetMyTeeTimesResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, GetMyTeeTimesResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public ValidateResponse cancelReservation(String reservationid,
			String golferId) {
		reservationid = Urls.urlEncode(reservationid);
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CancelReservation");
		builder.append("?reservationid=" + reservationid);
		builder.append("&golferid=" + golferId);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public GetMyFavoriteResponse getMyFavoriteCourses(String golferId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("FavoriteCourses");
		builder.append("?golferId=" + golferId);
		GetMyFavoriteResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, GetMyFavoriteResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public ValidateResponse addFavoriteCourse(String golferId, int courseId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("AddFavoriteCourse");
		builder.append("?golferId=" + golferId);
		builder.append("&courseId=" + courseId);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public ValidateResponse removeFavoriteCourse(String golferId, int courseId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.USER_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("RemoveFavoriteCourse");
		builder.append("?golferId=" + golferId);
		builder.append("&courseId=" + courseId);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public GetMyReviewsResponse getMyReviewsByGolfer(String golferId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("GetReviewsByGolfer");
		builder.append("?golferId=" + golferId);
		GetMyReviewsResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, GetMyReviewsResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public GolfCourseDetailResponse getMyCourseDetail(String golferId,
			int courseId) {
		golferId = Urls.urlEncode(golferId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.QUERY_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("CourseDetail");
		builder.append("?golferID=" + golferId);
		builder.append("&courseId=" + courseId);
		GolfCourseDetailResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null, GolfCourseDetailResponse.class,
						builder.toString().trim(), HttpMethod.GET, true);
		return response;
	}

	public ValidateResponse deleteCourseReview(int courseReviewId,
			String userId, int courseId) {
		userId = Urls.urlEncode(userId);
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.REVIEW_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("DeleteCourseReview");
		builder.append("?courseReviewId=" + courseReviewId);
		builder.append("&courseId=" + courseId);
		builder.append("&userId=" + userId);
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(null, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public ValidateResponse updateCourseReview(ReviewsUpdateBean bean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.REVIEW_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("UpdateCourseReview");
		ValidateResponse response = OpenTeeServiceClientImpl.getInstance()
				.executeUri(bean, ValidateResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}

	public BookingConfirmationResponse getReservationByConfirmationIdAndEmail(
			FindBookingBean findBookingBean) {
		StringBuilder builder = new StringBuilder();
		builder.append(Urls.BASE_URL);
		builder.append(Urls.BOOKING_API);
		builder.append(Urls.FIle_SEPARATOR);
		builder.append("GetReservationByConfirmationIdAndEmail");
		builder.append("?confirmationId=" + findBookingBean.getConfirmationId());
		builder.append("&email=" + findBookingBean.getEmail());
		BookingConfirmationResponse response = OpenTeeServiceClientImpl
				.getInstance().executeUri(null,
						BookingConfirmationResponse.class,
						builder.toString().trim(), HttpMethod.POST, true);
		return response;
	}
}
